Skip to content

LS26001308: kup-data-table: fix group and sort date column#2848

Merged
lucafoscili merged 1 commit intodevelopfrom
fix-sort-and-group-date-column
Apr 21, 2026
Merged

LS26001308: kup-data-table: fix group and sort date column#2848
lucafoscili merged 1 commit intodevelopfrom
fix-sort-and-group-date-column

Conversation

@pasere-smeup
Copy link
Copy Markdown
Collaborator

This pull request refactors how cell values are compared and sorted in the Ketchup data utilities, aiming to clarify and standardize the use of raw and decoded values during sorting and comparison operations. The main improvements involve consistently passing both the raw and decoded values to comparison functions and ensuring that the correct value is used depending on the data type (number, date, time, etc.).

Comparison and sorting logic improvements:

  • Updated compareCell and compareValues in cell-utils.ts to explicitly pass both value and decode fields, rather than using a fallback with ??, making the logic clearer and more predictable.
  • Changed the string comparison logic in compareValues to use decode if available, otherwise fallback to value, improving the handling of display vs. raw values.
  • For number, date, time, and timestamp comparisons, now consistently use the raw value field for parsing and conversion, ensuring accurate type-specific comparisons. [1] [2]

Sorting helper adjustments:

  • Simplified the sorting logic in kup-data-cell-helper.ts to always pass both value and the result of getValueForDisplay2 to compareValues, removing conditional logic based on type checks.

@lucafoscili lucafoscili merged commit 08d9a22 into develop Apr 21, 2026
1 check passed
@pasere-smeup pasere-smeup deleted the fix-sort-and-group-date-column branch April 21, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants